package MicroRpc.framework.protocol.http;

import MicroRpc.framework.beans.Invoker;
import MicroRpc.framework.loadbalance.LoadBalance;
import MicroRpc.framework.protocol.handler.AbstractProtocolHandler;
import MicroRpc.framework.beans.Url;

public class HttpProtocol extends AbstractProtocolHandler {


    public HttpProtocol(LoadBalance loadBalance) {
        super(loadBalance);
    }

    @Override
    public Object send(Invoker invoker) {
        Url url = loadBalance.selectUrl(invoker);
        return HttpClient.send(url,invoker);
    }

    @Override
    public void recv(Url url) {
        HttpServer.start(url);
    }



}
